const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const fzLocal = {
	GMHY_PMT100_PM25: {
        cluster: 65026,
        type: ['raw'],
        convert: (model, msg, publish, options, meta) => {
			
            return {pm25: msg.data[8]};
        },
    },
};

const definition  = {
        zigbeeModel: ['0001112b'],
        model: 'GMHY-PMT100',
        vendor: 'REXENSE',
        description: 'Air quality monitor',
        fromZigbee: [fz.temperature,fz.humidity,fzLocal.GMHY_PMT100_PM25, fz.battery],
        toZigbee: [],
        exposes: [e.temperature(), e.humidity(),e.pm25(), e.battery()],
};

module.exports = definition;
